namespace SDKLibrary
{

   /// The delegate of message report.
    public delegate void MsgReportEventHandler(Device devcie, string msg);

   /// The  delegate of parse the device feedback data .
    public delegate void ResolveInfoReportEventHandler(Device devcie, ResolveInfo msg);

    /// <summary>
    /// Communication management class.
    /// </summary>
    public class HDCommunicationManager : IDisposable
    {

        /// <summary>
        /// Normal message notification event.
        /// </summary>
        public event MsgReportEventHandler MsgReport;

       /// The event of return data has been parsed.
        public event ResolveInfoReportEventHandler ResolvedInfoReport;

         /// <summary>
        /// Create an object.
        /// </summary>
        public HDCommunicationManager();

        /// <summary>
        /// Listens using the specified local endpoint. Wait for the device to actively connect.
        /// </summary>
        /// <param name="localEP"></param>
        public void Listen(IPEndPoint localEP);

        /// <summary>
        ///Get a list of devices currently online.
        /// </summary>
        /// <returns></returns>
        public List<Device> GetDevices();

        /// <summary>
        /// Start scanning LAN devices.
        /// </summary>
       public void StartScanLANDevice();

        /// <summary>
        /// End scanning the LAN device.
        /// </summary>
        public void EndScanDevice();

        /// <summary>
        /// Add device
        /// </summary>
        /// <param name= "ip">deviceIP</param>
        /// <param name="exception">exception</param>
        /// <returns>If successful, it returns a device object, and if it fails, it returns null.</returns>
        public Device AddDevice(string ip, out string exception);

        /// <summary>
        /// Close a session with the client.
        /// </summary>
        /// <param name="device">device</param>
        public void Close(Device device);

        /// <summary>
        /// Close all client sessions and disconnect from all clients.
        /// </summary>
        public void CloseAllClient();

        /// <summary>
        /// Stop communication.
        /// </summary>
        public void Stop();

     ///...................................

     }

}